package com.zhipu.resetbalance.ui.activate;

import android.content.Intent;
import android.provider.Settings;
import android.text.TextUtils;

import androidx.databinding.ObservableField;
import androidx.lifecycle.ViewModel;

import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.DeviceUtils;
import com.zhipu.resetbalance.utils.InitializeUtils;


public class ActivateViewModel extends ViewModel {

    /**
     * MAC
     */
    public final ObservableField<String> mStringMAC = new ObservableField<>("MAC:" + DeviceUtils.getMacAddress().toUpperCase());

    /**
     * NS
     */
    public final ObservableField<String> serialNumber = new ObservableField<>("NS:" + android.os.Build.SERIAL);

    /**
     * 激活码
     */
    public final ObservableField<String> ActivationCode = new ObservableField("CF6945A1784A4C8E");


    /**
     * 设置WIFI
     */
    public void WIFISet(){
        Intent wifiSettingsIntent = new Intent(Settings.ACTION_WIFI_SETTINGS);
        wifiSettingsIntent.putExtra("extra_prefs_show_button_bar", true);
        wifiSettingsIntent.putExtra("extra_prefs_set_next_text", "完成");
        ActivityUtils.startActivity(wifiSettingsIntent);
    }



    public void ConfirmActivation(){
        if (TextUtils.isEmpty(ActivationCode.get())) {
            InitializeUtils.getDefaultMaker().show("请输入激活码");
            return;
        }

    }
}
